<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="/html/util.js"></script>
<script src="/html/axios.min.js"></script>
<script>
    var info = getQuery("errorLogin");
    window.onload = function (){
        if (info=="no"){
            $('landSpan').innerHTML = "对不起，请先登录"
        }
    }

    function land(){
        axios.get("/user/login",{
            params:{
                userName:$('name').value,
                pwd:$('pwd').value
            }
        }).then(e => {
            if (e.data == "ok"){
                location.href = "/html/index.html"
            }else {
                $("landSpan").innerHTML = "登录失败"
            }
        })
    }
</script>
<body>
    <span style="color: red" id="landSpan"></span><br>
    用户名:<input type="text" id="name"><br>
    密码:<input type="password" id="pwd"><br>
    <input type="button" value="提交" onclick="land()">
</body>
</html>